package com.imooc2.designPatterns.adaptor;

import com.imooc2.designPatterns.adaptor.dto.NewMethodDTO;
import com.imooc2.designPatterns.adaptor.service.NewService;
import com.imooc2.designPatterns.adaptor.service.impl.Adapter;
import com.imooc2.designPatterns.adaptor.service.impl.OldServiceImpl;
import com.imooc2.designPatterns.adaptor.vo.NewMethodVO;

public class Client {

    public static void main(String[] args) {
        OldServiceImpl oldServiceImpl = new OldServiceImpl();
        NewService newService = new Adapter(oldServiceImpl);
        NewMethodDTO newMethodDTO = new NewMethodDTO();
        newMethodDTO.setTest("新接口入参");
        NewMethodVO newMethodVO = newService.newMethod(newMethodDTO);
        //新街口返回参数
        System.out.println(newMethodVO.getTest());
    }

}
